﻿<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<umbPackage>
  <files>
    <file>
      <guid>PackageActionsContrib.dll</guid>
      <orgPath>/bin</orgPath>
      <orgName>PackageActionsContrib.dll</orgName>
    </file>
    <file>
      <guid>URGSystems.Umbraco.uVersionClientCache.dll</guid>
      <orgPath>/bin</orgPath>
      <orgName>URGSystems.Umbraco.uVersionClientCache.dll</orgName>
    </file>
  </files>
  <info>
    <package>
      <name>uVersionClientCache</name>
      <version>v0.1</version>
      <license url="http://www.opensource.org/licenses/mit-license.php">MIT license</license>
      <url>http://uVersionClientCache.codeplex.com/</url>
      <requirements>
        <major>3</major>
        <minor>0</minor>
        <patch>0</patch>
      </requirements>
    </package>
    <author>
      <name>Patrick McAndrew</name>
      <website>http://www.urg.name</website>
    </author>
    <readme><![CDATA[uVersionClientCache is a custom macro to always automatically version (URL querstring parameter) your files based on a MD5 hash of the file contents or file last modified date to prevent issues with client browsers caching an old file after you have changed it.]]></readme>
  </info>
  <DocumentTypes />
  <Templates />
  <Stylesheets />
  <Macros>
    <macro>
      <name>uVersionClientCache</name>
      <alias>uVersionClientCache</alias>
      <scriptType>URGSystems.Umbraco.uVersionClientCache.VersionGenerator</scriptType>
      <scriptAssembly>URGSystems.Umbraco.uVersionClientCache</scriptAssembly>
      <xslt>
      </xslt>
      <useInEditor>False</useInEditor>
      <refreshRate>0</refreshRate>
      <scriptingFile>
      </scriptingFile>
      <properties>
        <property name="Filename" alias="filename" show="True" propertyType="text" />
        <property name="Output Type" alias="outputType" show="True" propertyType="text" />
        <property name="Version Type" alias="versionType" show="True" propertyType="text" />
      </properties>
    </macro>
  </Macros>
  <DictionaryItems />
  <Languages />
  <DataTypes />
  <Actions>
    <Action runat="install" undo="false" alias="ExecuteSql">
      <![CDATA[
    if not exists(select * from  cmsMacroPropertyType where  macroPropertyTypeAlias = 'uVersionCacheClientVersionType') begin
        insert into cmsMacroPropertyType (  macroPropertyTypeAlias, macroPropertyTypeRenderAssembly, macroPropertyTypeRenderType, macroPropertyTypeBaseType )
        values ( 'uVersionCacheClientVersionType', 'URGSystems.Umbraco.uVersionClientCache', 'VersionTypeDropDownList', 'String')
    end
    if not exists(select * from  cmsMacroPropertyType where  macroPropertyTypeAlias = 'uVersionCacheClientOutputType') begin
        insert into cmsMacroPropertyType (  macroPropertyTypeAlias, macroPropertyTypeRenderAssembly, macroPropertyTypeRenderType, macroPropertyTypeBaseType )
        values ( 'uVersionCacheClientOutputType', 'URGSystems.Umbraco.uVersionClientCache', 'OutputTypeDropDownList', 'String')
    end
    ]]>
    </Action>
    <Action runat="install" undo="false" alias="ExecuteSql">
      <![CDATA[
update cmsMacroProperty 
  set macroPropertyType = (select id from cmsMacroPropertyType where macroPropertyTypeAlias='uVersionCacheClientVersionType')
  where macro = (select id from cmsMacro where macroAlias = 'uVersionClientCache')
  and macroPropertyAlias = 'versionType'
  
update cmsMacroProperty 
  set macroPropertyType = (select id from cmsMacroPropertyType where macroPropertyTypeAlias='uVersionCacheClientOutputType')
  where macro = (select id from cmsMacro where macroAlias = 'uVersionClientCache')
  and macroPropertyAlias = 'outputType'  
          
    ]]>
    </Action>
  </Actions>
</umbPackage>